import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import { fromEvent,take} from 'rxjs'
import './index.css'

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)

root.render(<App />)



// 执行一次
// const handler = (e: MouseEvent)  => {
//   console.log(e)
//   document.body.removeEventListener('click', handler)
// }

// document.body.addEventListener('click', handler)

// fromEvent(document.body, 'click').pipe(take(1)).subscribe(console.log)